<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Regeist_model extends CI_Model{
	
	//用户注册
	public function regeist($data,$username){
		$datas = $this->db->select('username')->where(array('username'=>$username))->get('admin')->result_array();
//		p($datas);
		foreach($datas as $key => $value){
			if(isset($value)){
				error('你输入的用户名已存在','home/register');
			}
		}
			$this->db->insert('admin',$data);
	}
}